1. 나의 말:

  2. ChatGPT의 말:

    네. 아래처럼 C++Builder VCL에서 자주 사용하는 컴포넌트 80개를 기준으로, 컴포넌트 → 주요 속성 → 설명 → 간단한 C++ 예제 코드 형태의 표로 정리할 수 있습니다.

    #VCL 컴포넌트주요 속성설명예제 코드
    1TFormCaption, Width, Height, Color, Position폼(윈도우)의 기본 설정Caption = "Main"; Width = 800;
    2TLabelCaption, AutoSize, Font, Color문자열 표시Label1->Caption = "Hello";
    3TEditText, MaxLength, ReadOnly, PasswordChar한 줄 문자열 입력Edit1->Text = "ABC";
    4TMemoLines, ReadOnly, ScrollBars, WordWrap여러 줄 텍스트 입력/표시Memo1->Lines->Add("Hello");
    5TRichEditLines, SelText, SelAttributes, ReadOnly서식 있는 텍스트 편집RichEdit1->SelAttributes->Color = clRed;
    6TButtonCaption, Enabled, Default, Cancel일반 명령 버튼Button1->Caption = "확인";
    7TBitBtnCaption, Kind, Glyph, ModalResult이미지가 포함된 버튼BitBtn1->Kind = bkOK;
    8TSpeedButtonCaption, Down, GroupIndex, Style툴바/토글 버튼SpeedButton1->Down = true;
    9TCheckBoxChecked, AllowGrayed, State체크 선택CheckBox1->Checked = true;
    10TRadioButtonChecked, Caption여러 항목 중 하나 선택RadioButton1->Checked = true;
    11TComboBoxItems, ItemIndex, Text, Style드롭다운 선택ComboBox1->Items->Add("서울");
    12TListBoxItems, ItemIndex, MultiSelect, Sorted목록 표시/선택ListBox1->Items->Add("Apple");
    13TCheckListBoxItems, Checked, MultiSelect체크 가능한 목록CheckListBox1->Checked[0] = true;
    14TScrollBarPosition, Min, Max, Kind스크롤 값 조절ScrollBar1->Position = 50;
    15TTrackBarPosition, Min, Max, Orientation슬라이더 값 조절TrackBar1->Position = 30;
    16TUpDownPosition, Min, Max, Increment숫자 증감 버튼UpDown1->Position = 10;
    17TProgressBarPosition, Min, Max, Style진행 상태 표시ProgressBar1->Position = 50;
    18TStatusBarPanels, SimpleText, SimplePanel상태 표시줄StatusBar1->SimpleText = "Ready";
    19TMainMenuItems, Images, AutoHotkeys메인 메뉴MainMenu1->Items->Items[0]->Caption = "파일";
    20TPopupMenuItems, AutoPopup마우스 우클릭 메뉴PopupMenu1->Popup(Mouse->CursorPos().x, Mouse->CursorPos().y);
    21TImagePicture, Stretch, Center, Proportional이미지 표시Image1->Picture->LoadFromFile("a.bmp");
    22TImageListImages, Width, Height, ColorDepth이미지 목록 관리ImageList1->Add(Image1->Picture->Bitmap, nullptr);
    23TShapeShape, Brush, Pen사각형/원 등의 도형 표시Shape1->Shape = stCircle;
    24TBevelShape, Style, Width화면 구분선/입체선Bevel1->Shape = bsTopLine;
    25TPanelCaption, Align, BevelOuter, Color컨트롤 그룹/영역Panel1->Align = alTop;
    26TGroupBoxCaption, Align, Color컨트롤 그룹화GroupBox1->Caption = "설정";
    27TRadioGroupItems, ItemIndex, Columns라디오 버튼 그룹RadioGroup1->Items->Add("남성");
    28TPageControlActivePage, Align, TabPosition탭 페이지 관리PageControl1->ActivePage = TabSheet2;
    29TTabSheetCaption, ImageIndex, PageControlPageControl의 탭TabSheet1->Caption = "일반";
    30TScrollBoxHorzScrollBar, VertScrollBar, AutoScroll스크롤 가능한 영역ScrollBox1->AutoScroll = true;
    31TPanelAlign, Anchors, Constraints레이아웃 영역Panel1->Align = alClient;
    32TSplitterAlign, MinSize, Beveled영역 크기 조절Splitter1->MinSize = 100;
    33TTimerInterval, Enabled일정 시간마다 이벤트 실행Timer1->Interval = 1000;
    34TOpenDialogFileName, Filter, InitialDir, Options파일 열기 대화상자if (OpenDialog1->Execute()) Edit1->Text = OpenDialog1->FileName;
    35TSaveDialogFileName, Filter, InitialDir파일 저장 대화상자SaveDialog1->Execute();
    36TFontDialogFont, Color, Options글꼴 선택 대화상자if(FontDialog1->Execute()) Label1->Font = FontDialog1->Font;
    37TColorDialogColor, Options색상 선택if(ColorDialog1->Execute()) Panel1->Color = ColorDialog1->Color;
    38TPrintDialogOptions, Copies, FromPage인쇄 설정 대화상자PrintDialog1->Execute();
    39TPrinterSetupDialogOptions프린터 설정PrinterSetupDialog1->Execute();
    40TFindDialogFindText, Options문자열 찾기FindDialog1->FindText = "hello";
    41TReplaceDialogFindText, ReplaceText, Options문자열 찾아 바꾸기ReplaceDialog1->ReplaceText = "world";
    42TDateTimePickerDate, Time, Format, Kind날짜/시간 선택DateTimePicker1->Date = Date();
    43TMonthCalendarDate, MultiSelect, SelStart, SelEnd달력 표시/선택MonthCalendar1->Date = Date();
    44TMaskEditEditMask, Text입력 형식 제한MaskEdit1->EditMask = "0000-00-00";
    45TStaticTextCaption, BorderStyle, Alignment고정 텍스트 표시StaticText1->Caption = "상태";
    46THeaderControlSections, Images, FullDrag컬럼 헤더 표시HeaderControl1->Sections->Add()->Text = "이름";
    47TToolBarButtons, ButtonWidth, Images, Flat툴바ToolBar1->Images = ImageList1;
    48TToolButtonCaption, Style, ImageIndex, Down툴바 버튼ToolButton1->ImageIndex = 0;
    49TStatusBarSimpleText, Panels하단 상태 정보 표시StatusBar1->SimpleText = "작업 완료";
    50TStringGridCells, RowCount, ColCount, FixedRows문자열 표 형태 데이터StringGrid1->Cells[0][0] = "이름";
    51TDrawGridRowCount, ColCount, DefaultRowHeight직접 그리는 GridDrawGrid1->RowCount = 10;
    52TListViewItems, Columns, ViewStyle, Selected리스트/상세 목록ListView1->ViewStyle = vsReport;
    53TTreeViewItems, Selected, Images, ReadOnly트리 구조 표시TreeView1->Items->Add(nullptr, "Root");
    54TTreeNodeText, Parent, ChildCount, ExpandedTreeView의 노드Node->Expanded = true;
    55TStatusBarPanels, SimpleText상태 표시StatusBar1->SimpleText = "완료";
    56TProgressBarPosition, Max, Min작업 진행률ProgressBar1->Position++;
    57TTabControlTabs, TabIndex, MultiLine단순 탭 컨트롤TabControl1->TabIndex = 1;
    58TComboBoxExItemsEx, Images, ItemIndex이미지가 있는 ComboBoxComboBoxEx1->ItemsEx->Add();
    59TListViewColumns, Items, ViewStyle상세 리스트ListView1->Columns->Add()->Caption = "Name";
    60TStringGridCells, Objects, ColWidths표 형태 데이터StringGrid1->ColWidths[0] = 150;
    61TDBTextDataSource, DataField, AlignmentDB 필드 표시DBText1->DataField = "NAME";
    62TDBEditDataSource, DataField, ReadOnlyDB 필드 편집DBEdit1->DataField = "NAME";
    63TDBMemoDataSource, DataField, ReadOnlyDB Memo 필드DBMemo1->DataField = "MEMO";
    64TDBImageDataSource, DataField, AutoDisplayDB 이미지 필드DBImage1->DataField = "PHOTO";
    65TDBComboBoxDataSource, DataField, ItemsDB 연결 ComboBoxDBComboBox1->DataField = "TYPE";
    66TDBCheckBoxDataSource, DataField, ValueCheckedDB Boolean 필드DBCheckBox1->ValueChecked = "Y";
    67TDBRadioGroupDataSource, DataField, ItemsDB 라디오 그룹DBRadioGroup1->Items->Add("남");
    68TDBListBoxDataSource, DataField, ItemsDB 연결 목록DBListBox1->DataField = "TYPE";
    69TDBLookupComboBoxListSource, KeyField, ListField다른 테이블을 참조하는 ComboBoxDBLookupComboBox1->ListField = "NAME";
    70TDBGridDataSource, Columns, OptionsDB 데이터를 표로 표시DBGrid1->DataSource = DataSource1;
    71TDBNavigatorDataSource, VisibleButtonsDB 레코드 이동/편집DBNavigator1->DataSource = DataSource1;
    72TDataSourceDataSet, AutoEditDataset과 DB 컨트롤 연결DataSource1->DataSet = Query1;
    73TClientDataSetActive, FieldDefs, FileName메모리/클라이언트 DatasetClientDataSet1->Active = true;
    74TFDConnectionParams, Connected, LoginPromptFireDAC DB 연결FDConnection1->Connected = true;
    75TFDQuerySQL, Active, Params, ConnectionSQL 실행 및 조회FDQuery1->SQL->Text = "SELECT * FROM USER";
    76TFDTableTableName, Active, Connection테이블 직접 접근FDTable1->TableName = "CUSTOMER";
    77TFDTransactionOptions, ConnectionDB 트랜잭션 관리FDConnection1->StartTransaction();
    78TADOConnectionConnectionString, Connected, LoginPromptADO DB 연결ADOConnection1->Connected = true;
    79TADOQuerySQL, Active, Parameters, ConnectionADO SQL 실행ADOQuery1->SQL->Text = "SELECT * FROM TEST";
    80TADOTableTableName, Active, ConnectionADO 테이블 접근ADOTable1->TableName = "CUSTOMER";

    기본적으로 같이 알아두면 좋은 공통 속성

    VCL 컴포넌트를 공부할 때는 개별 컴포넌트의 속성뿐 아니라 다음 공통 속성을 먼저 이해하면 좋습니다.

    속성의미예제
    Name코드에서 사용하는 컴포넌트 이름Button1->Name = "btnOK";
    Caption화면에 표시되는 문자열Button1->Caption = "확인";
    Enabled사용 가능/비활성 상태Button1->Enabled = false;
    Visible화면 표시 여부Panel1->Visible = false;
    Left부모 기준 X 위치Button1->Left = 100;
    Top부모 기준 Y 위치Button1->Top = 50;
    Width가로 크기Button1->Width = 120;
    Height세로 크기Button1->Height = 40;
    Align부모 영역에 대한 배치 방식Panel1->Align = alClient;
    Anchors부모 크기 변경 시 고정 기준Button1->Anchors << akRight;
    Color배경색Panel1->Color = clYellow;
    Font글꼴 설정Label1->Font->Size = 14;
    ParentFont부모 글꼴 상속Label1->ParentFont = false;
    ParentColor부모 색상 상속Panel1->ParentColor = false;
    TabOrderTab 이동 순서Edit1->TabOrder = 0;
    TabStopTab 이동 대상 여부Button1->TabStop = true;
    Hint마우스 오버 설명Button1->Hint = "저장";
    ShowHintHint 표시 여부Button1->ShowHint = true;
    Cursor마우스 커서 모양Button1->Cursor = crHandPoint;
    OnClick클릭 이벤트Button1->OnClick = ButtonClick;
    OnChange값 변경 이벤트Edit1->OnChange = EditChange;
    OnEnter포커스 진입 이벤트Edit1->OnEnter = EditEnter;
    OnExit포커스 이탈 이벤트Edit1->OnExit = EditExit;

    예를 들어 버튼 클릭 이벤트는 다음과 같은 형태입니다.

    void __fastcall TForm1::Button1Click(TObject *Sender)
    {
        ShowMessage("버튼을 클릭했습니다.");
    }
    

    그리고 TEdit, TComboBox, TCheckBox 등을 코드에서 다룰 때는 보통 다음처럼 사용합니다.

    // Edit
    Edit1->Text = "홍길동";
    
    // ComboBox
    ComboBox1->ItemIndex = 0;
    
    // CheckBox
    if (CheckBox1->Checked)
    {
        ShowMessage("체크됨");
    }
    
    // Label
    Label1->Caption = Edit1->Text;
    
    // Panel
    Panel1->Color = clSkyBlue;
    

    원하시면 이 표를 더 확장해서 TForm부터 TFDQuery까지 약 100개를 대상으로 속성 5~15개 + 각 속성별 설명 + 실전 예제 코드 + 주요 이벤트 + 사용 목적까지 포함한 C++Builder VCL 컴포넌트 사전 형태로 만들어 드릴 수 있습니다.

ChatGPT는 AI라 실수할 수 있습니다.

현재 채팅을 지울까요?

새 채팅을 시작하면 현재 대화가 삭제됩니다. 채팅을 저장하려면 하거나 하세요.

로그인 또는 회원가입

더 스마트한 응답, 파일 및 이미지 업로드 등을 이용할 수 있습니다.

대화형 콘텐츠